package com.weiyan.blog;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter;

/**
 * @author misterWei
 * @create 2020年01月19号:23点33分
 * @mailbox mynameisweiyan@gmail.com
 */
@SpringBootApplication(scanBasePackages = "com.weiyan.blog")
@EnableEurekaClient
public class BlogAuthApplication {
    public static void main(String[] args) {
        SpringApplication.run(BlogAuthApplication.class,args);
    }

    /**
     * 解决 JPA no session 问题
     * @return
     */
    @Bean
    public OpenEntityManagerInViewFilter getNoSession(){
        return new OpenEntityManagerInViewFilter();
    }

}
